﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Pg.BioMedics.SDR.Caching.Configuration
{
    /// <summary>
    /// Caching block settings element
    /// </summary>
    public class SettingsElement : ConfigurationElement
    {
        #region Constants

        private const string InProcessProperty = "inProcess";
        private const string CacheNameProperty = "cacheName";        

        #endregion

        #region Properties

        /// <summary>
        /// Gets / sets value indicating if in process cache should be used instead of 
        /// distributed cache
        /// </summary>
        [ConfigurationProperty(InProcessProperty)]
        public bool InProcess
        {
            get
            {
                return (bool)this[InProcessProperty];
            }

            set
            {
                this[InProcessProperty] = value;
            }
        }

        /// <summary>
        /// Gets / sets name of the distributed cache utilized by the caching block
        /// </summary>
        [ConfigurationProperty(CacheNameProperty)]
        public string CacheName
        {
            get
            {
                return this[CacheNameProperty] as string;
            }

            set
            {
                this[CacheNameProperty] = value;
            }
        }

        #endregion
    }
}
